//
//  HotSearchCell.m
//  diaoyuren
//
//  Created by JIADAOBANK on 16/2/18.
//  Copyright © 2016年 game. All rights reserved.
//

#import "HotSearchCell.h"

@implementation HotSearchCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.backgroundColor = [UIColor clearColor];

        self.selectionStyle = 0;
    }
    return self;
}
-(void)setHotArr:(NSArray *)HotArr
{
    
    _HotArr=HotArr;
    for (int i=0; i<_HotArr.count; i++) {
        UIButton *btn=[UIButton buttonWithType:UIButtonTypeSystem];
        btn.frame=CGRectMake(i%3*(((SCREEN_WIDTH-40)/3)+10)+10, i/3*(30+10)+10, (SCREEN_WIDTH-40)/3,30);
        [self.contentView addSubview:btn];
        btn.backgroundColor=[UIColor whiteColor];
        
        
        btn.layer.borderColor = linColor.CGColor;
        btn.layer.borderWidth = 0.3;
        
        [btn setTitle:_HotArr[i] forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        btn.titleLabel.font = font(SCREEN_WIDTH*0.04);
        [btn addTarget:self action:@selector(HotBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    }

}
  //点击热卖选项按钮调代理方法-(void)ClickHotBtn;
-(void)HotBtnAction:(UIButton *)btn
{
    if ([self.delegate respondsToSelector:@selector(ClickHotBtnWhithString:)]) {
        [self.delegate ClickHotBtnWhithString:btn.currentTitle];
    }
}
@end
